package com.voda.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.voda.dao.api.IRoleDao;
import com.voda.entity.Role;
import com.voda.service.api.IRoleService;

/**
 * The Class RoleServiceImpl.
 */
@Service
public class RoleServiceImpl implements IRoleService {
	
	/** The role dao. */
	@Autowired
	private IRoleDao roleDao;

	/* (non-Javadoc)
	 * @see com.voda.service.api.IGenericService#addRecord(java.lang.Object)
	 */
	@Override
	@Transactional
	public Long addRecord(Role entity) {
		return roleDao.addRecord(entity);
	}

	/* (non-Javadoc)
	 * @see com.voda.service.api.IGenericService#deleteRecord(java.lang.Long)
	 */
	@Override
	@Transactional
	public void deleteRecord(Long id) {
		roleDao.deleteRecord(id);
	}

	/* (non-Javadoc)
	 * @see com.voda.service.api.IGenericService#updateRecord(java.lang.Object)
	 */
	@Override
	@Transactional
	public void updateRecord(Role entity) {
		roleDao.updateRecord(entity);
	}

	/* (non-Javadoc)
	 * @see com.voda.service.api.IGenericService#getRecordById(java.lang.Long)
	 */
	@Override
	@Transactional
	public Role getRecordById(Long id) {
		return roleDao.getRecordById(id);
	}

	/* (non-Javadoc)
	 * @see com.voda.service.api.IGenericService#getAll()
	 */
	@Override
	@Transactional
	public List<Role> getAll() {
		return roleDao.getAll();
	}

	/* (non-Javadoc)
	 * @see com.voda.service.api.IGenericService#getRecordsPage(java.lang.Integer, java.lang.Integer)
	 */
	@Override
	@Transactional
	public List<Role> getRecordsPage(Integer startPage, Integer pageSize) {
		return roleDao.getRecordsPage(startPage, pageSize);
	}

	/* (non-Javadoc)
	 * @see com.voda.service.api.IGenericService#count()
	 */
	@Override
	@Transactional
	public Integer count() {
		return roleDao.count();
	}

}
